import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    username:'小明',
    islogin:localStorage.getItem('token')?true:false,
    token:localStorage.getItem('token')?localStorage.getItem('token'):''
  },
  mutations: {
    changename(store,username){
      store.username=username.username
      store.islogin=username.isLogin
      store.token=username.token
    }
  },
  actions: {
  },
  modules: {
  }
})
